{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class beverage():\n",
    "    name=\"\"\n",
    "    price=0.0\n",
    "    type=\"BEVERAGE\"\n",
    "    def getprice(self):\n",
    "        return self.price\n",
    "    def setprice(self,price):\n",
    "        self.price=price\n",
    "    def getname(self):\n",
    "        return self.name\n",
    "class coke(beverage):\n",
    "    def __init__(self):\n",
    "        self.name=\"cilk\"\n",
    "        self.price=5.0\n",
    "class drinkdecorator():\n",
    "    def getnamew(self):\n",
    "        pass\n",
    "    def getprice(self):\n",
    "        pass\n",
    "class icedecorator(drinkdecorator):\n",
    "    def __init__(self,beverage):\n",
    "        self.beverage=beverage\n",
    "    def getname(self):\n",
    "        return self.beverage.getname()\n",
    "    def getprice(self):\n",
    "        return self.beverage.getprice()\n",
    "class sugardecorator(drinkdecorator):\n",
    "    def __init__(self,beverage):\n",
    "        self.beverage=beverage\n",
    "    def getname(self):\n",
    "        return self.beverage.getname()+\"+suger\"\n",
    "    def getprice(self):\n",
    "        return self.beverage.getprice()+0.8\n",
    "    \n",
    "if __name__=='__main__':\n",
    "    milk1=milk()\n",
    "    print(milk1.getprice(),milk1.getname())\n",
    "    \n",
    "    icemilk=icedecorator(milk1)\n",
    "    \n",
    "    print(icemilk.getprice(),icemilk.getname())\n",
    "    cofe1=coke()\n",
    "    print(cofe1.getprice,cofe1.getname())\n",
    "    sugarcofe=sugardecorator(cofe1)\n",
    "    \n",
    "    print(sugarcofe.getprice(),sugarcofe.getname())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
